home *** CD-ROM | disk | FTP | other *** search
/ Mac-Source 1994 July / Mac-Source_July_1994.iso / C and C++ / System / Dirent ƒ / sys_dirent.h < prev   
Text File  |  1993-07-04  |  1KB  |  44 lines

  1. /****************************************************************************************
  2.  *
  3.  *    File:        sys_dirent.h
  4.  *    Created:    7/3/93        By:    George T. Talbot
  5.  *    Purpose:    Implements UNIX-like directory reading for the Macintosh.
  6.  *                Filesystem-independent directory information.
  7.  *
  8.  *    Modifications:
  9.  *
  10.  *    Notes:
  11.  *            1) These routines will NOT work under A/UX.
  12.  *            2) WD = working directory
  13.  *            3) CD = change directory
  14.  *            4) FS = file system
  15.  *            5) Mac filesystems allow spaces as part of pathnames!
  16.  *            6) All routines which return a path use the default Macintosh path separator,
  17.  *               a colon (":").
  18.  *
  19.  ****************************************************************************************/
  20.  
  21. #ifndef    __sys_dirent_h
  22. #define    __sys_dirent_h
  23.  
  24. #include <Files.h>
  25.  
  26. struct    dirent {
  27.     /* PRIVATE FIELDS.  Use fields after PUBLIC    */
  28.     struct dirent    **next;
  29.     FSSpec            fsp;
  30.     
  31.     /*    PUBLIC.    */
  32.     long            d_off;                    /* index (to seekdir()) of this entry */    
  33.     long            d_fileno;                /* File number (dirID) of this entry    */
  34. #define    d_parent    fsp.parID                /* File number (dirID) of parent    */
  35. #define    d_reclen    sizeof(struct dirent)    /* Size of this record    */
  36. #define    d_namelen    strlen(fsp.name)        /*    Length of the name    */
  37. #define    d_name        fsp.name                /*    Name    */
  38. #define    d_volume    fsp.vRefNum
  39. };
  40.  
  41. #define    DIRSIZ(dp) sizeof(struct dirent)
  42.  
  43. #endif    /* !__sys_dirent_h */
  44.